<!DOCTYPE HTML>
<html>

<head>
	<link rel="bookmark"  type="image/x-icon"  href="/img/logo_miccall.png"/>
	<link rel="shortcut icon" href="/img/logo_miccall.png">
	
			    <title>
    Ame雨
    </title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <link rel="stylesheet" href="/amelin-ting/css/mic_main.css" />
    <link rel="stylesheet" href="/amelin-ting/css/dropdownMenu.css" />
    <meta name="keywords" content="Ame雨" />
    
    	<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
	 
    <noscript>
        <link rel="stylesheet" href="/amelin-ting/css/noscript.css" />
    </noscript>
    <style type="text/css">
        body:before {
          content: ' ';
          position: fixed;
          top: 0;
          background: url('/amelin-ting/img/bg.jpg') center 0 no-repeat;
          right: 0;
          bottom: 0;
          left: 0;
          background-size: cover; 
        }
    </style>

			    
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script async type="text/javascript" src="//cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


    <script src="/amelin-ting/js/jquery.min.js"></script>
    <script src="/amelin-ting/js/jquery.scrollex.min.js"></script>
    <script src="/amelin-ting/js/jquery.scrolly.min.js"></script>
    <script src="/amelin-ting/js/skel.min.js"></script>
    <script src="/amelin-ting/js/util.js"></script>
    <script src="/amelin-ting/js/main.js"></script>
	
<meta name="generator" content="Hexo 5.4.0"></head>
    
		
<!-- Layouts -->



<!--  代码渲染  -->
<link rel="stylesheet" href="/css/prism_coy.css" />
<link rel="stylesheet" href="/css/typo.css" />
<!-- 文章页 -->
<body class="is-loading">
    <!-- Wrapper 外包 s-->
    <div id="wrapper" class="fade-in">
        <!-- Intro 头部显示 s -->
        <!-- Intro 头部显示 e -->
        <!-- Header 头部logo start -->
        <header id="header">
    <a href="/amelin-ting/" class="logo">Art Space</a>
</header>
        <!-- Nav 导航条 start -->
        <nav id="nav" class="special" >
            <ul class="menu links" >
			<!-- Homepage  主页  --> 
			<li >
	            <a href="/amelin-ting/" rel="nofollow">主页</a>
	        </li>
			<!-- categories_name  分类   --> 
	        
	        <li class="active">
	            <a href="#s1">分类</a>
	                    <ul class="submenu">
	                        <li>
	                        <a class="category-link" href="/amelin-ting/categories/Go/">Go</a></li><li><a class="category-link" href="/amelin-ting/categories/django/">django</a></li><li><a class="category-link" href="/amelin-ting/categories/drf/">drf</a></li><li><a class="category-link" href="/amelin-ting/categories/gin/">gin</a></li><li><a class="category-link" href="/amelin-ting/categories/go/">go</a></li><li><a class="category-link" href="/amelin-ting/categories/linux/">linux</a></li><li><a class="category-link" href="/amelin-ting/categories/mysql/">mysql</a></li><li><a class="category-link" href="/amelin-ting/categories/python/">python</a></li><li><a class="category-link" href="/amelin-ting/categories/%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/">内网穿透</a></li><li><a class="category-link" href="/amelin-ting/categories/%E5%89%8D%E7%AB%AF/">前端</a>
	                    </ul>
	        </li>
	        
	        <!-- archives  归档   --> 
	        
	        
		        <!-- Pages 自定义   -->
		        
		        <li>
		            <a href="/about/" title="简历">
		                简历
		            </a>
		        </li>
		        
		        <li>
		            <a href="/group/" title="团队">
		                团队
		            </a>
		        </li>
		        
		        <li>
		            <a href="/gallery/" title="图库">
		                图库
		            </a>
		        </li>
		        
		        <li>
		            <a href="/tag/" title="标签">
		                标签
		            </a>
		        </li>
		        


            </ul>
            <!-- icons 图标   -->
			<ul class="icons">
                    
                    <li>
                        <a title="github" href="https://github.com/miccall" target="_blank" rel="noopener">
                            <i class="icon fa fa-github"></i>
                        </a>
                    </li>
                    
                    <li>
                        <a title="500px" href="http://500px.com" target="_blank" rel="noopener">
                            <i class="icon fa fa-500px"></i>
                        </a>
                    </li>
                    
			</ul>
</nav>

        <div id="main" >
            <div class ="post_page_title_img" style="height: 25rem;background-image: url(https://img1.baidu.com/it/u=140664568,4037820699&amp;fm=26&amp;fmt=auto);background-position: center; background-repeat:no-repeat; background-size:cover;-moz-background-size:cover;overflow:hidden;" >
                <a href="#" style="padding: 4rem 4rem 2rem 4rem ;"><h2 >前端jQuery</h2></a>
            </div>
            <!-- Post -->
            <div class="typo" style="padding: 3rem;">
                <h1 id="jQuery"><a href="#jQuery" class="headerlink" title="jQuery"></a>jQuery</h1><h2 id="一、什么是jQuery"><a href="#一、什么是jQuery" class="headerlink" title="一、什么是jQuery"></a>一、什么是jQuery</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">jQuery内部封装了原生的JS代码(还额外添加了很多功能)</span></span><br><span class="line"><span class="comment">能够让你通过书写更少的代码 完成JS操作</span></span><br><span class="line"><span class="comment">类似于python里面的模块 在前端模块不叫模块 叫&#x27;类库&#x27;</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">兼容多个浏览器的 你在使用jQuery的时候就不需要考虑浏览器兼容问题</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">jQuery的宗旨</span></span><br><span class="line"><span class="comment">	write less do more</span></span><br><span class="line"><span class="comment">	让你用更少的代码完成更多的事情</span></span><br><span class="line"><span class="comment">	</span></span><br><span class="line"><span class="comment">复习</span></span><br><span class="line"><span class="comment">	python导入模块发生了哪些事？</span></span><br><span class="line"><span class="comment">		导入模块其实需要消耗资源</span></span><br><span class="line"><span class="comment">	jQuery在使用的时候也需要导入</span></span><br><span class="line"><span class="comment">		但是它的文件非常的小(几十KB) 基本不影响网络速度</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">jQuery学习目录</span></span><br><span class="line"><span class="comment">    选择器</span></span><br><span class="line"><span class="comment">    筛选器</span></span><br><span class="line"><span class="comment">    样式操作</span></span><br><span class="line"><span class="comment">    文本操作</span></span><br><span class="line"><span class="comment">    属性操作</span></span><br><span class="line"><span class="comment">    文档处理</span></span><br><span class="line"><span class="comment">    事件</span></span><br><span class="line"><span class="comment">    动画效果</span></span><br><span class="line"><span class="comment">    插件</span></span><br><span class="line"><span class="comment">    each、data、Ajax(重点 django部分学)</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">jQuery文件下载</span></span><br><span class="line"><span class="comment">	压缩  		容量更小</span></span><br><span class="line"><span class="comment">	未压缩</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">jQuery在使用之前 一定要确保已经导入了</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>

<h2 id="二、针对导入问题"><a href="#二、针对导入问题" class="headerlink" title="二、针对导入问题"></a>二、针对导入问题</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1.</span>文件下载到了本地 如何解决多个文件反复书写引入语句的代码</span><br><span class="line">	可以借助于pycharm自动初始化代码功能能完成自动添加</span><br><span class="line">    配置</span><br><span class="line">    	编辑</span><br><span class="line">        file and code template</span><br><span class="line">  <span class="comment">// 我不想下载jQuery文件 能不能使用呢？</span></span><br><span class="line"></span><br><span class="line"><span class="number">2.</span> 直接引入jQuery提供的CDN服务(基于网络直接请求加载)</span><br><span class="line">	<span class="attr">CDN</span>:内容分发网络</span><br><span class="line">    CDN也有免费的也有收费的</span><br><span class="line">    前端免费的网站</span><br><span class="line">    	bootcdn</span><br><span class="line">    &lt;script src=<span class="string">&quot;https://cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js&quot;</span>&gt;&lt;/script&gt;</span><br><span class="line">	<span class="string">&quot;&quot;</span><span class="string">&quot;你的计算机必须要有网络&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="number">3.</span> jQuery基本语法</span><br><span class="line">	jQuery(选择器).action()</span><br><span class="line">	但是秉承着jQuery的宗旨 jQuery简写为 $</span><br><span class="line">    jQuery() === $()</span><br><span class="line"></span><br><span class="line"><span class="number">4.</span> jQuery与js代码对比</span><br><span class="line">	<span class="attr">eg</span>:将p标签内部的文本颜色改为红色</span><br><span class="line">    <span class="comment">// 原生js代码操作标签</span></span><br><span class="line">    	<span class="keyword">let</span> pEle = <span class="built_in">document</span>.getElementByID(<span class="string">&#x27;d1&#x27;</span>)</span><br><span class="line">        pEle.style.color = <span class="string">&#x27;red&#x27;</span></span><br><span class="line">	<span class="comment">// jQuery操作标签</span></span><br><span class="line">		$(<span class="string">&#x27;p&#x27;</span>).css(<span class="string">&#x27;color&#x27;</span>, <span class="string">&#x27;bule&#x27;</span>)</span><br></pre></td></tr></table></figure>

<h2 id="三、如何查找标签"><a href="#三、如何查找标签" class="headerlink" title="三、如何查找标签"></a>三、如何查找标签</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1.</span>基本选择器</span><br><span class="line">	<span class="number">1.1</span> id 选择器</span><br><span class="line">    	$(<span class="string">&#x27;#d1&#x27;</span>)</span><br><span class="line">	</span><br><span class="line">	<span class="number">1.2</span> <span class="class"><span class="keyword">class</span>选择器</span></span><br><span class="line"><span class="class">    	$(&#x27;.<span class="title">c1</span>&#x27;)</span></span><br><span class="line"><span class="class"></span></span><br><span class="line"><span class="class">	1.3 标签选择器</span></span><br><span class="line"><span class="class">    	$(&#x27;<span class="title">span</span>&#x27;)</span></span><br><span class="line"><span class="class"></span></span><br><span class="line"><span class="class">// <span class="title">jQuery</span>对象如何变成标签对象</span></span><br><span class="line"><span class="class"><span class="title">undefined</span></span></span><br><span class="line"><span class="class">$(&#x27;#<span class="title">d1</span>&#x27;)[0]</span></span><br><span class="line"><span class="class">&lt;<span class="title">div</span> <span class="title">id</span></span>=​<span class="string">&quot;d1&quot;</span>&gt;​…​&lt;/div&gt;​</span><br><span class="line"><span class="built_in">document</span>.getElementById(<span class="string">&#x27;d1&#x27;</span>)</span><br><span class="line">&lt;div id=​<span class="string">&quot;d1&quot;</span>&gt;​…​&lt;/div&gt;​</span><br><span class="line"></span><br><span class="line"><span class="comment">// 标签对象如何转jQuery对象</span></span><br><span class="line"><span class="literal">undefined</span></span><br><span class="line">$(<span class="built_in">document</span>.getElementById(<span class="string">&#x27;d1&#x27;</span>))</span><br><span class="line">w.fn.init [div#d1]</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="number">2.</span> 组合选择器/分组与嵌套</span><br><span class="line">	$(<span class="string">&#x27;div&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [div#d1, div.c1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;div.c1&#x27;</span>)</span><br><span class="line">    w.fn.init [div.c1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: div.c1length: 1prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line">    $(<span class="string">&#x27;div#d1&#x27;</span>)</span><br><span class="line">    w.fn.init [div#d1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;*&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">19</span>) [html, head, meta, title, meta, link, script, script, body, span, span, div#d1, span, p#d2, span, span, div.c1, span, span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;#d1,.c1,p&#x27;</span>)  # 并列+混用</span><br><span class="line">    w.fn.init(<span class="number">3</span>) [div#d1, p#d2, div.c1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;div span&#x27;</span>)  # 后代</span><br><span class="line">    w.fn.init(<span class="number">3</span>) [span, span, span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;div&gt;span&#x27;</span>)  # 儿子</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [span, span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;div+span&#x27;</span>)  # 毗邻</span><br><span class="line">    w.fn.init [span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;div~span&#x27;</span>)  # 弟弟</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [span, span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    </span><br><span class="line"><span class="number">3.</span> 基本筛选器</span><br><span class="line">    $(<span class="string">&#x27;ul li&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">10</span>) [li, li, li, li, li, li, li.c1, li, li#d1, li, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;ul li:first&#x27;</span>)  # 大儿子 </span><br><span class="line">    w.fn.init [li, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: lilength: 1prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;ul li:last&#x27;</span>)  # 小儿子</span><br><span class="line">    w.fn.init [li, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: lilength: 1prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;ul li:eq(2)&#x27;</span>)		# 放索引</span><br><span class="line">    w.fn.init [li, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: lilength: 1prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;ul li:even&#x27;</span>)  # 偶数索引 <span class="number">0</span>包含在内</span><br><span class="line">    w.fn.init(<span class="number">5</span>) [li, li, li, li.c1, li#d1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: li1: li2: li3: li.c14: li#d1length: 5prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;ul li:odd&#x27;</span>)  # 奇数索引</span><br><span class="line">    w.fn.init(<span class="number">5</span>) [li, li, li, li, li, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: li1: li2: li3: li4: lilength: 5prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;ul li:gt(2)&#x27;</span>)  # 大于索引</span><br><span class="line">    w.fn.init(<span class="number">7</span>) [li, li, li, li.c1, li, li#d1, li, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: li1: li2: li3: li.c14: li5: li#d16: lilength: 7prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;ul li:lt(2)&#x27;</span>)  # 小于索引</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [li, li, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: li1: lilength: 2prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;ul li:not(&quot;#d1&quot;)&#x27;</span>)  # 移除满足条件的标签</span><br><span class="line">    w.fn.init(<span class="number">9</span>) [li, li, li, li, li, li, li.c1, li, li, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;div&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [div, div, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;div:has(&quot;p&quot;)&#x27;</span>)  # 选取出包含一个或多个标签在内的标签</span><br><span class="line">    w.fn.init [div, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line"><span class="number">4.</span> 属性选择器</span><br><span class="line">    $(<span class="string">&#x27;[username]&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">3</span>) [input, input, p, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;[username=&quot;jason&quot;]&#x27;</span>)</span><br><span class="line">    w.fn.init [input, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;p[username=&quot;egon&quot;]&#x27;</span>)</span><br><span class="line">    w.fn.init [p, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;[type]&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [input, input, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;[type=&quot;text&quot;]&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [input, input, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    </span><br><span class="line"><span class="number">5.</span> 表单筛选器</span><br><span class="line">    $(<span class="string">&#x27;input[type=&quot;text&quot;]&#x27;</span>)</span><br><span class="line">    w.fn.init [input, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: inputlength: 1prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line">    $(<span class="string">&#x27;input[type=&quot;password&quot;]&#x27;</span>)</span><br><span class="line">    w.fn.init [input, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;:text&#x27;</span>)  # 等价于上面第一个</span><br><span class="line">    w.fn.init [input, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: inputlength: 1prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line">    $(<span class="string">&#x27;:password&#x27;</span>)  # 等价于上面第二个</span><br><span class="line">    w.fn.init [input, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    </span><br><span class="line">    :text</span><br><span class="line">    :password</span><br><span class="line">    :file</span><br><span class="line">    :radio</span><br><span class="line">    :checkbox</span><br><span class="line">    :submit</span><br><span class="line">    :reset</span><br><span class="line">    :button</span><br><span class="line">    ...</span><br><span class="line"></span><br><span class="line">    表单对象属性</span><br><span class="line">    :enabled</span><br><span class="line">    :disabled</span><br><span class="line">    :checked</span><br><span class="line">    :selected</span><br><span class="line">    <span class="string">&quot;&quot;</span><span class="string">&quot;特殊情况&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line">    $(<span class="string">&#x27;:checked&#x27;</span>)  # 它会将checked和selected都拿到</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [input, option, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: input1: optionlength: 2prevObject: w.fn.init [<span class="built_in">document</span>]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line">    $(<span class="string">&#x27;:selected&#x27;</span>)  # 它不会 只拿selected</span><br><span class="line">    w.fn.init [option, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;input:checked&#x27;</span>)  # 自己加一个限制条件</span><br><span class="line">    w.fn.init [input, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    </span><br><span class="line"><span class="number">6.</span> 筛选器方法</span><br><span class="line">    $(<span class="string">&#x27;#d1&#x27;</span>).next()  # 同级别下一个</span><br><span class="line">    w.fn.init [span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: spanlength: 1prevObject: w.fn.init [span#d1]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line">    $(<span class="string">&#x27;#d1&#x27;</span>).nextAll()</span><br><span class="line">    w.fn.init(<span class="number">5</span>) [span, div#d2, span, span, span.c1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: span1: div#d22: span3: span4: span.c1length: 5prevObject: w.fn.init [span#d1]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line">    $(<span class="string">&#x27;#d1&#x27;</span>).nextUntil(<span class="string">&#x27;.c1&#x27;</span>)  # 不包括最后一个</span><br><span class="line">    w.fn.init(<span class="number">4</span>) [span, div#d2, span, span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: span1: div#d22: span3: spanlength: 4prevObject: w.fn.init [span#d1]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;.c1&#x27;</span>).prev()  # 上一个</span><br><span class="line">    w.fn.init [span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: spanlength: 1prevObject: w.fn.init [span.c1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line">    $(<span class="string">&#x27;.c1&#x27;</span>).prevAll()</span><br><span class="line">    w.fn.init(<span class="number">5</span>) [span, span, div#d2, span, span#d1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;.c1&#x27;</span>).prevUntil(<span class="string">&#x27;#d2&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [span, span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;#d3&#x27;</span>).parent()  # 第一级父标签</span><br><span class="line">    w.fn.init [p, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]<span class="number">0</span>: plength: 1prevObject: w.fn.init [span#d3]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line">    $(<span class="string">&#x27;#d3&#x27;</span>).parent().parent()</span><br><span class="line">    w.fn.init [div#d2, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;#d3&#x27;</span>).parent().parent().parent()</span><br><span class="line">    w.fn.init [body, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;#d3&#x27;</span>).parent().parent().parent().parent()</span><br><span class="line">    w.fn.init [html, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;#d3&#x27;</span>).parent().parent().parent().parent().parent()</span><br><span class="line">    w.fn.init [<span class="built_in">document</span>, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;#d3&#x27;</span>).parent().parent().parent().parent().parent().parent()</span><br><span class="line">    w.fn.init [prevObject: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;#d3&#x27;</span>).parents()</span><br><span class="line">    w.fn.init(<span class="number">4</span>) [p, div#d2, body, html, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;#d3&#x27;</span>).parentsUntil(<span class="string">&#x27;body&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [p, div#d2, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;#d2&#x27;</span>).children()  # 儿子</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;#d2&#x27;</span>).siblings()  # 同级别上下所有</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;div p&#x27;</span>)</span><br><span class="line">    # 等价           </span><br><span class="line">    $(<span class="string">&#x27;div&#x27;</span>).find(<span class="string">&#x27;p&#x27;</span>)  # find从某个区域内筛选出想要的标签 </span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    <span class="string">&quot;&quot;</span><span class="string">&quot;下述两两等价&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line">    $(<span class="string">&#x27;div span:first&#x27;</span>)</span><br><span class="line">    w.fn.init [span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;div span&#x27;</span>).first()</span><br><span class="line">    w.fn.init [span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">3</span>)]<span class="number">0</span>: spanlength: 1prevObject: w.fn.init(<span class="number">3</span>) [span, span#d3, span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]__proto__: <span class="built_in">Object</span>(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;div span:last&#x27;</span>)</span><br><span class="line">    w.fn.init [span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;div span&#x27;</span>).last()</span><br><span class="line"></span><br><span class="line">    w.fn.init [span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">3</span>)]</span><br><span class="line">    $(<span class="string">&#x27;div span:not(&quot;#d3&quot;)&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [span, span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">    $(<span class="string">&#x27;div span&#x27;</span>).not(<span class="string">&#x27;#d3&#x27;</span>)</span><br><span class="line">    w.fn.init(<span class="number">2</span>) [span, span, <span class="attr">prevObject</span>: w.fn.init(<span class="number">3</span>)]</span><br></pre></td></tr></table></figure>

<h2 id="四、操作标签"><a href="#四、操作标签" class="headerlink" title="四、操作标签"></a>四、操作标签</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br></pre></td><td class="code"><pre><span class="line"># 操作类</span><br><span class="line"><span class="string">&quot;&quot;</span><span class="string">&quot;</span></span><br><span class="line"><span class="string">js版本														jQuery版本</span></span><br><span class="line"><span class="string">classList.add()										addClass()</span></span><br><span class="line"><span class="string">classList.remove()								removeClass()</span></span><br><span class="line"><span class="string">classList.contains()							hasClass()</span></span><br><span class="line"><span class="string">classList.toggle()								toggleClass()</span></span><br><span class="line"><span class="string">&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line"></span><br><span class="line"># css操作</span><br><span class="line">&lt;p&gt;<span class="number">111</span>&lt;/p&gt;</span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">p</span>&gt;</span>222<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span></span><br><span class="line"><span class="string">&quot;&quot;</span><span class="string">&quot;一行代码将第一个p标签变成红色第二个p标签变成绿色&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line">$(<span class="string">&#x27;p&#x27;</span>).first().css(<span class="string">&#x27;color&#x27;</span>,<span class="string">&#x27;red&#x27;</span>).next().css(<span class="string">&#x27;color&#x27;</span>,<span class="string">&#x27;green&#x27;</span>)</span><br><span class="line"># jQuery的链式操作 使用jQuery可以做到一行代码操作很多标签</span><br><span class="line"># jQuery对象调用jQuery方法之后返回的还是当前jQuery对象 也就可以继续调用其他方法</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MyClass</span>(<span class="title">object</span>):</span></span><br><span class="line"><span class="class">    <span class="title">def</span> <span class="title">func1</span>(<span class="title">self</span>):</span></span><br><span class="line"><span class="class">        <span class="title">print</span>(&#x27;<span class="title">func1</span>&#x27;)</span></span><br><span class="line"><span class="class">        <span class="title">return</span> <span class="title">self</span></span></span><br><span class="line"><span class="class"></span></span><br><span class="line"><span class="class">    <span class="title">def</span> <span class="title">func2</span>(<span class="title">self</span>):</span></span><br><span class="line"><span class="class">        <span class="title">print</span>(&#x27;<span class="title">func2</span>&#x27;)</span></span><br><span class="line"><span class="class">        <span class="title">return</span> <span class="title">self</span></span></span><br><span class="line"><span class="class"><span class="title">obj</span> </span>= MyClass()</span><br><span class="line">obj.func1().func2()</span><br><span class="line"></span><br><span class="line"># 位置操作</span><br><span class="line">offset()  # 相对于浏览器窗口</span><br><span class="line">position()  # 相对于父标签</span><br><span class="line"></span><br><span class="line">scrollTop()		# 需要了解</span><br><span class="line">  $(<span class="built_in">window</span>).scrollTop()</span><br><span class="line">  <span class="number">0</span></span><br><span class="line">  $(<span class="built_in">window</span>).scrollTop()</span><br><span class="line">  <span class="number">969</span></span><br><span class="line">  $(<span class="built_in">window</span>).scrollTop()  # 括号内不加参数就是获取</span><br><span class="line">  <span class="number">1733</span></span><br><span class="line">  $(<span class="built_in">window</span>).scrollTop(<span class="number">0</span>)  # 加了参数就是设置</span><br><span class="line">  n.fn.init [Window]</span><br><span class="line">  $(<span class="built_in">window</span>).scrollTop(<span class="number">500</span>)</span><br><span class="line">  n.fn.init [Window]</span><br><span class="line">scrollLeft()</span><br><span class="line"></span><br><span class="line"># 尺寸</span><br><span class="line">$(<span class="string">&#x27;p&#x27;</span>).height()  # 文本</span><br><span class="line"><span class="number">20</span></span><br><span class="line">$(<span class="string">&#x27;p&#x27;</span>).width()</span><br><span class="line"><span class="number">1670</span></span><br><span class="line">$(<span class="string">&#x27;p&#x27;</span>).innerHeight()  # 文本+padding</span><br><span class="line"><span class="number">26</span></span><br><span class="line">$(<span class="string">&#x27;p&#x27;</span>).innerWidth()</span><br><span class="line"><span class="number">1674</span></span><br><span class="line">$(<span class="string">&#x27;p&#x27;</span>).outerHeight()  # 文本+padding+border</span><br><span class="line"><span class="number">26</span></span><br><span class="line">$(<span class="string">&#x27;p&#x27;</span>).outerWidth()</span><br><span class="line"><span class="number">1674</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 文本操作</span><br><span class="line"><span class="string">&quot;&quot;</span><span class="string">&quot;</span></span><br><span class="line"><span class="string">操作标签内部文本</span></span><br><span class="line"><span class="string">js											jQuery</span></span><br><span class="line"><span class="string">innerText								text()  括号内不加参数就是获取加了就是设置</span></span><br><span class="line"><span class="string">innerHTML								html()</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">$(&#x27;div&#x27;).text()</span></span><br><span class="line"><span class="string">&quot;</span></span><br><span class="line">    </span><br><span class="line">        有些话听听就过去了，不要在意，都是成年人!</span><br><span class="line">    </span><br><span class="line"><span class="string">&quot;</span></span><br><span class="line"><span class="string">$(&#x27;div&#x27;).html()</span></span><br><span class="line"><span class="string">&quot;</span></span><br><span class="line">    &lt;p&gt;</span><br><span class="line">        有些话听听就过去了，不要在意，都是成年人!</span><br><span class="line">    &lt;/p&gt;</span><br><span class="line"><span class="string">&quot;</span></span><br><span class="line"><span class="string">$(&#x27;div&#x27;).text(&#x27;你们都是我的大宝贝&#x27;)</span></span><br><span class="line"><span class="string">w.fn.init [div, prevObject: w.fn.init(1)]</span></span><br><span class="line"><span class="string">$(&#x27;div&#x27;).html(&#x27;你个臭妹妹&#x27;)</span></span><br><span class="line"><span class="string">w.fn.init [div, prevObject: w.fn.init(1)]</span></span><br><span class="line"><span class="string">$(&#x27;div&#x27;).text(&#x27;&lt;h1&gt;你们都是我的大宝贝&lt;/h1&gt;&#x27;)</span></span><br><span class="line"><span class="string">w.fn.init [div, prevObject: w.fn.init(1)]</span></span><br><span class="line"><span class="string">$(&#x27;div&#x27;).html(&#x27;&lt;h1&gt;你个臭妹妹&lt;/h1&gt;&#x27;)</span></span><br><span class="line"><span class="string">w.fn.init [div, prevObject: w.fn.init(1)]</span></span><br><span class="line"><span class="string">&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line"># 获取值操作</span><br><span class="line"><span class="string">&quot;&quot;</span><span class="string">&quot;</span></span><br><span class="line"><span class="string">js													jQuery</span></span><br><span class="line"><span class="string">.value											.val()</span></span><br><span class="line"><span class="string">&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).val()</span><br><span class="line"><span class="string">&quot;sasdasdsadsadad&quot;</span></span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).val(<span class="string">&#x27;520快乐&#x27;</span>)  # 括号内不加参数就是获取加了就是设置</span><br><span class="line"></span><br><span class="line">w.fn.init [input#d1]</span><br><span class="line">$(<span class="string">&#x27;#d2&#x27;</span>).val()</span><br><span class="line"><span class="string">&quot;C:\fakepath\01_测试路由.png&quot;</span></span><br><span class="line">$(<span class="string">&#x27;#d2&#x27;</span>)[<span class="number">0</span>].files[<span class="number">0</span>]  # 牢记两个对象之间的转换</span><br><span class="line">File &#123;<span class="attr">name</span>: <span class="string">&quot;01_测试路由.png&quot;</span>, <span class="attr">lastModified</span>: <span class="number">1557043083000</span>, <span class="attr">lastModifiedDate</span>: Sun May <span class="number">05</span> <span class="number">2019</span> <span class="number">15</span>:<span class="number">58</span>:<span class="number">03</span> GMT+<span class="number">0800</span> (中国标准时间), <span class="attr">webkitRelativePath</span>: <span class="string">&quot;&quot;</span>, <span class="attr">size</span>: <span class="number">28733</span>, …&#125;</span><br><span class="line">           </span><br><span class="line">           </span><br><span class="line"># 属性操作</span><br><span class="line"><span class="string">&quot;&quot;</span><span class="string">&quot;</span></span><br><span class="line"><span class="string">js中																jQuery</span></span><br><span class="line"><span class="string">setAttribute()											attr(name,value)</span></span><br><span class="line"><span class="string">getAttribute()											attr(name)</span></span><br><span class="line"><span class="string">removeAttribute()										removeAttr(name)</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">在用变量存储对象的时候 js中推荐使用	</span></span><br><span class="line"><span class="string">	XXXEle			标签对象</span></span><br><span class="line"><span class="string">jQuery中推荐使用</span></span><br><span class="line"><span class="string">	$XXXEle			jQuery对象</span></span><br><span class="line"><span class="string">&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line"><span class="keyword">let</span> $pEle = $(<span class="string">&#x27;p&#x27;</span>)</span><br><span class="line"><span class="literal">undefined</span></span><br><span class="line">$pEle.attr(<span class="string">&#x27;id&#x27;</span>)</span><br><span class="line"><span class="string">&quot;d1&quot;</span></span><br><span class="line">$pEle.attr(<span class="string">&#x27;class&#x27;</span>)</span><br><span class="line"><span class="literal">undefined</span></span><br><span class="line">$pEle.attr(<span class="string">&#x27;class&#x27;</span>,<span class="string">&#x27;c1&#x27;</span>)</span><br><span class="line">w.fn.init [p#d1.c1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">$pEle.attr(<span class="string">&#x27;id&#x27;</span>,<span class="string">&#x27;id666&#x27;</span>)</span><br><span class="line">w.fn.init [p#id666.c1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">$pEle.attr(<span class="string">&#x27;password&#x27;</span>,<span class="string">&#x27;jason123&#x27;</span>)</span><br><span class="line">w.fn.init [p#id666.c1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">$pEle.removeAttr(<span class="string">&#x27;password&#x27;</span>)</span><br><span class="line">w.fn.init [p#id666.c1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]       </span><br><span class="line">      </span><br><span class="line">           </span><br><span class="line"><span class="string">&quot;&quot;</span><span class="string">&quot;</span></span><br><span class="line"><span class="string">对于标签上有的能够看到的属性和自定义属性用attr</span></span><br><span class="line"><span class="string">对于返回布尔值比如checkbox radio option是否被选中用prop</span></span><br><span class="line"><span class="string">&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line">           </span><br><span class="line">$(<span class="string">&#x27;#d3&#x27;</span>).attr(<span class="string">&#x27;checked&#x27;</span>)</span><br><span class="line"><span class="string">&quot;checked&quot;</span></span><br><span class="line">$(<span class="string">&#x27;#d2&#x27;</span>).attr(<span class="string">&#x27;checked&#x27;</span>)</span><br><span class="line"><span class="literal">undefined</span></span><br><span class="line">$(<span class="string">&#x27;#d2&#x27;</span>).attr(<span class="string">&#x27;checked&#x27;</span>)</span><br><span class="line"><span class="literal">undefined</span></span><br><span class="line">$(<span class="string">&#x27;#d4&#x27;</span>).attr(<span class="string">&#x27;checked&#x27;</span>)</span><br><span class="line"><span class="literal">undefined</span></span><br><span class="line">$(<span class="string">&#x27;#d3&#x27;</span>).attr(<span class="string">&#x27;checked&#x27;</span>)</span><br><span class="line"><span class="string">&quot;checked&quot;</span></span><br><span class="line">$(<span class="string">&#x27;#d3&#x27;</span>).attr(<span class="string">&#x27;checked&#x27;</span>,<span class="string">&#x27;checked&#x27;</span>)  # 无效</span><br><span class="line">w.fn.init [input#d3]</span><br><span class="line">           </span><br><span class="line">           </span><br><span class="line">$(<span class="string">&#x27;#d2&#x27;</span>).prop(<span class="string">&#x27;checked&#x27;</span>)</span><br><span class="line"><span class="literal">false</span></span><br><span class="line">$(<span class="string">&#x27;#d2&#x27;</span>).prop(<span class="string">&#x27;checked&#x27;</span>)</span><br><span class="line"><span class="literal">true</span></span><br><span class="line">$(<span class="string">&#x27;#d3&#x27;</span>).prop(<span class="string">&#x27;checked&#x27;</span>,<span class="literal">true</span>)</span><br><span class="line">w.fn.init [input#d3]</span><br><span class="line">$(<span class="string">&#x27;#d3&#x27;</span>).prop(<span class="string">&#x27;checked&#x27;</span>,<span class="literal">false</span>)</span><br><span class="line">w.fn.init [input#d3]</span><br><span class="line">           </span><br><span class="line">           </span><br><span class="line"># 文档处理</span><br><span class="line"><span class="string">&quot;&quot;</span><span class="string">&quot;</span></span><br><span class="line"><span class="string">js																		jQuery</span></span><br><span class="line"><span class="string">createElement(&#x27;p&#x27;)										$(&#x27;&lt;p&gt;&#x27;)</span></span><br><span class="line"><span class="string">appendChild()													append()</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">&quot;</span><span class="string">&quot;&quot;</span></span><br><span class="line"><span class="keyword">let</span> $pEle = $(<span class="string">&#x27;&lt;p&gt;&#x27;</span>)</span><br><span class="line">$pEle.text(<span class="string">&#x27;你好啊 草莓要不要来几个?&#x27;</span>)</span><br><span class="line">$pEle.attr(<span class="string">&#x27;id&#x27;</span>,<span class="string">&#x27;d1&#x27;</span>)          </span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).append($pEle)  # 内部尾部追加</span><br><span class="line">$pEle.appendTo($(<span class="string">&#x27;#d1&#x27;</span>)) </span><br><span class="line">           </span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).prepend($pEle)  # 内部头部追加</span><br><span class="line">w.fn.init [div#d1]</span><br><span class="line">$pEle.prependTo($(<span class="string">&#x27;#d1&#x27;</span>))</span><br><span class="line">w.fn.init [p#d1, <span class="attr">prevObject</span>: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">         </span><br><span class="line">$(<span class="string">&#x27;#d2&#x27;</span>).after($pEle)  # 放在某个标签后面</span><br><span class="line">w.fn.init [p#d2]</span><br><span class="line">$pEle.insertAfter($(<span class="string">&#x27;#d1&#x27;</span>))</span><br><span class="line">        </span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).before($pEle)</span><br><span class="line">w.fn.init [div#d1]</span><br><span class="line">$pEle.insertBefore($(<span class="string">&#x27;#d2&#x27;</span>))</span><br><span class="line"></span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).remove()  # 将标签从DOM树中删除</span><br><span class="line">w.fn.init [div#d1]</span><br><span class="line">           </span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).empty()  # 清空标签内部所有的内容</span><br><span class="line">w.fn.init [div#d1]</span><br></pre></td></tr></table></figure>

<h2 id="五、事件"><a href="#五、事件" class="headerlink" title="五、事件"></a>五、事件</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1.</span>第一种</span><br><span class="line">    $(<span class="string">&#x27;#d1&#x27;</span>).click(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            alert(<span class="string">&#x27;别说话 吻我&#x27;</span>)</span><br><span class="line">    &#125;);</span><br><span class="line">  </span><br><span class="line"><span class="number">2.</span>第二种(功能更加强大 还支持事件委托)</span><br><span class="line">    $(<span class="string">&#x27;#d2&#x27;</span>).on(<span class="string">&#x27;click&#x27;</span>,<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            alert(<span class="string">&#x27;借我钱买草莓 后面还你&#x27;</span>)</span><br><span class="line">    &#125;)</span><br></pre></td></tr></table></figure>

<h2 id="六、克隆事件"><a href="#六、克隆事件" class="headerlink" title="六、克隆事件"></a>六、克隆事件</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&lt;button id=<span class="string">&quot;d1&quot;</span>&gt;屠龙宝刀，点击就送&lt;/button&gt;</span><br><span class="line"></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></span></span><br><span class="line"><span class="javascript"><span class="xml">    $(<span class="string">&#x27;#d1&#x27;</span>).on(<span class="string">&#x27;click&#x27;</span>,<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span></span><br><span class="line"><span class="javascript"><span class="xml">        <span class="built_in">console</span>.log(<span class="built_in">this</span>)  <span class="comment">// this指代是当前被操作的标签对象</span></span></span></span><br><span class="line"><span class="javascript"><span class="xml">        $(<span class="built_in">this</span>).clone().insertAfter($(<span class="string">&#x27;body&#x27;</span>))  <span class="comment">// clone默认情况下只克隆html和css 不克隆事件</span></span></span></span><br><span class="line"><span class="javascript"><span class="xml">        $(<span class="built_in">this</span>).clone(<span class="literal">true</span>).insertAfter($(<span class="string">&#x27;body&#x27;</span>))  <span class="comment">// 括号内加true即可克隆事件</span></span></span></span><br><span class="line"><span class="javascript"><span class="xml"></span></span></span><br><span class="line"><span class="javascript"><span class="xml">    &#125;)</span></span></span><br><span class="line"><span class="javascript"><span class="xml"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span></span><br></pre></td></tr></table></figure>

<h2 id="七、自定义模态框"><a href="#七、自定义模态框" class="headerlink" title="七、自定义模态框"></a>七、自定义模态框</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&quot;&quot;</span><span class="string">&quot;</span></span><br><span class="line"><span class="string">模态框内部本质就是给标签移除或者添加上hide属性</span></span><br><span class="line"><span class="string">&quot;</span><span class="string">&quot;&quot;</span></span><br></pre></td></tr></table></figure>

<h2 id="八、左侧菜单"><a href="#八、左侧菜单" class="headerlink" title="八、左侧菜单"></a>八、左侧菜单</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">&lt;script&gt;</span><br><span class="line">    $(<span class="string">&#x27;.title&#x27;</span>).click(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        <span class="comment">// 先给所有的items加hide</span></span><br><span class="line">        $(<span class="string">&#x27;.items&#x27;</span>).addClass(<span class="string">&#x27;hide&#x27;</span>)</span><br><span class="line">        <span class="comment">// 然后将被点击标签内部的hide移除</span></span><br><span class="line">        $(<span class="built_in">this</span>).children().removeClass(<span class="string">&#x27;hide&#x27;</span>)</span><br><span class="line">    &#125;)</span><br><span class="line">&lt;/script&gt;</span><br><span class="line">&lt;!--尝试用一行代码搞定上面的操作--&gt;</span><br></pre></td></tr></table></figure>

<h2 id="九、返回顶部"><a href="#九、返回顶部" class="headerlink" title="九、返回顶部"></a>九、返回顶部</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">&lt;script&gt;</span><br><span class="line">    $(<span class="built_in">window</span>).scroll(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        <span class="keyword">if</span>($(<span class="built_in">window</span>).scrollTop() &gt; <span class="number">300</span>)&#123;</span><br><span class="line">            $(<span class="string">&#x27;#d1&#x27;</span>).removeClass(<span class="string">&#x27;hide&#x27;</span>)</span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            $(<span class="string">&#x27;#d1&#x27;</span>).addClass(<span class="string">&#x27;hide&#x27;</span>)</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;)</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure>

<h2 id="十、自定义登陆校验"><a href="#十、自定义登陆校验" class="headerlink" title="十、自定义登陆校验"></a>十、自定义登陆校验</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"># 在获取用户的用户名和密码的时候 用户如果没有填写 应该给用户展示提示信息</span><br><span class="line">&lt;p&gt;username:</span><br><span class="line">    <span class="xml"><span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;text&quot;</span> <span class="attr">id</span>=<span class="string">&quot;username&quot;</span>&gt;</span></span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">span</span> <span class="attr">style</span>=<span class="string">&quot;color: red&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">p</span>&gt;</span>password:</span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">&quot;text&quot;</span> <span class="attr">id</span>=<span class="string">&quot;password&quot;</span>&gt;</span></span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">span</span> <span class="attr">style</span>=<span class="string">&quot;color: red&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">button</span> <span class="attr">id</span>=<span class="string">&quot;d1&quot;</span>&gt;</span>提交<span class="tag">&lt;/<span class="name">button</span>&gt;</span></span></span><br><span class="line"><span class="xml"></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></span></span><br><span class="line"><span class="javascript"><span class="xml">    <span class="keyword">let</span> $userName = $(<span class="string">&#x27;#username&#x27;</span>)</span></span></span><br><span class="line"><span class="javascript"><span class="xml">    <span class="keyword">let</span> $passWord = $(<span class="string">&#x27;#password&#x27;</span>)</span></span></span><br><span class="line"><span class="javascript"><span class="xml">    $(<span class="string">&#x27;#d1&#x27;</span>).click(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span></span><br><span class="line"><span class="javascript"><span class="xml">        <span class="comment">// 获取用户输入的用户名和密码 做校验</span></span></span></span><br><span class="line"><span class="javascript"><span class="xml">        <span class="keyword">let</span> userName = $userName.val()</span></span></span><br><span class="line"><span class="javascript"><span class="xml">        <span class="keyword">let</span> passWord = $passWord.val()</span></span></span><br><span class="line"><span class="javascript"><span class="xml">        <span class="keyword">if</span> (!userName)&#123;</span></span></span><br><span class="line"><span class="javascript"><span class="xml">            $userName.next().text(<span class="string">&quot;用户名不能为空&quot;</span>)</span></span></span><br><span class="line"><span class="javascript"><span class="xml">        &#125;</span></span></span><br><span class="line"><span class="javascript"><span class="xml">        <span class="keyword">if</span> (!passWord)&#123;</span></span></span><br><span class="line"><span class="javascript"><span class="xml">            $passWord.next().text(<span class="string">&#x27;密码不能为空&#x27;</span>)</span></span></span><br><span class="line"><span class="javascript"><span class="xml">        &#125;</span></span></span><br><span class="line"><span class="javascript"><span class="xml">    &#125;)</span></span></span><br><span class="line"><span class="javascript"><span class="xml">    $(<span class="string">&#x27;input&#x27;</span>).focus(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span></span><br><span class="line"><span class="javascript"><span class="xml">        $(<span class="built_in">this</span>).next().text(<span class="string">&#x27;&#x27;</span>)</span></span></span><br><span class="line"><span class="javascript"><span class="xml">    &#125;)</span></span></span><br><span class="line"><span class="javascript"><span class="xml"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span></span><br></pre></td></tr></table></figure>

<h2 id="十一、input实时监控"><a href="#十一、input实时监控" class="headerlink" title="十一、input实时监控"></a>十一、input实时监控</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&lt;input type=<span class="string">&quot;text&quot;</span> id=<span class="string">&quot;d1&quot;</span>&gt;</span><br><span class="line"></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></span></span><br><span class="line"><span class="javascript"><span class="xml">    $(<span class="string">&#x27;#d1&#x27;</span>).on(<span class="string">&#x27;input&#x27;</span>,<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span></span><br><span class="line"><span class="javascript"><span class="xml">        <span class="built_in">console</span>.log(<span class="built_in">this</span>.value)  </span></span></span><br><span class="line"><span class="javascript"><span class="xml">    &#125;)</span></span></span><br><span class="line"><span class="javascript"><span class="xml"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span></span><br></pre></td></tr></table></figure>

<h2 id="十二、hover事件"><a href="#十二、hover事件" class="headerlink" title="十二、hover事件"></a>十二、hover事件</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&lt;script&gt;</span><br><span class="line">    <span class="comment">// $(&quot;#d1&quot;).hover(function () &#123;  // 鼠标悬浮 + 鼠标移开</span></span><br><span class="line">    <span class="comment">//     alert(123)</span></span><br><span class="line">    <span class="comment">// &#125;)</span></span><br><span class="line"></span><br><span class="line">    $(<span class="string">&#x27;#d1&#x27;</span>).hover(</span><br><span class="line">        <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            alert(<span class="string">&#x27;我来了&#x27;</span>)  <span class="comment">// 悬浮</span></span><br><span class="line">    &#125;,</span><br><span class="line">        <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            alert(<span class="string">&#x27;我溜了&#x27;</span>)  <span class="comment">// 移开</span></span><br><span class="line">        &#125;</span><br><span class="line">    )</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure>

<h2 id="十三、键盘按键按下事件"><a href="#十三、键盘按键按下事件" class="headerlink" title="十三、键盘按键按下事件"></a>十三、键盘按键按下事件</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">&lt;script&gt;</span><br><span class="line">    $(<span class="built_in">window</span>).keydown(<span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>&#123;</span><br><span class="line">        <span class="built_in">console</span>.log(event.keyCode)</span><br><span class="line">        <span class="keyword">if</span> (event.keyCode === <span class="number">16</span>)&#123;</span><br><span class="line">            alert(<span class="string">&#x27;你按了shift键&#x27;</span>)</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;)</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure>

<h2 id="十四、阻止后续事件执行"><a href="#十四、阻止后续事件执行" class="headerlink" title="十四、阻止后续事件执行"></a>十四、阻止后续事件执行</h2><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></span><br><span class="line"><span class="javascript">    $(<span class="string">&#x27;#d2&#x27;</span>).click(<span class="function"><span class="keyword">function</span> (<span class="params">e</span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">        $(<span class="string">&#x27;#d1&#x27;</span>).text(<span class="string">&#x27;宝贝 你能看到我吗?&#x27;</span>)</span></span><br><span class="line"><span class="javascript">        <span class="comment">// 阻止标签后续事件的执行 方式1</span></span></span><br><span class="line"><span class="javascript">        <span class="comment">// return false</span></span></span><br><span class="line"><span class="javascript">        <span class="comment">// 阻止标签后续事件的执行 方式2</span></span></span><br><span class="line"><span class="javascript">        <span class="comment">// e.preventDefault()</span></span></span><br><span class="line"><span class="javascript">    &#125;)</span></span><br><span class="line"><span class="javascript"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></table></figure>

<h2 id="十五、阻止事件冒泡"><a href="#十五、阻止事件冒泡" class="headerlink" title="十五、阻止事件冒泡"></a>十五、阻止事件冒泡</h2><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></span><br><span class="line"><span class="javascript">        $(<span class="string">&#x27;#d1&#x27;</span>).click(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">            alert(<span class="string">&#x27;div&#x27;</span>)</span></span><br><span class="line"><span class="javascript">        &#125;)</span></span><br><span class="line"><span class="javascript">        $(<span class="string">&#x27;#d2&#x27;</span>).click(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">            alert(<span class="string">&#x27;p&#x27;</span>)</span></span><br><span class="line"><span class="javascript">        &#125;)</span></span><br><span class="line"><span class="javascript">        $(<span class="string">&#x27;#d3&#x27;</span>).click(<span class="function"><span class="keyword">function</span> (<span class="params">e</span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">            alert(<span class="string">&#x27;span&#x27;</span>)</span></span><br><span class="line"><span class="javascript">            <span class="comment">// 阻止事件冒泡的方式1</span></span></span><br><span class="line"><span class="javascript">            <span class="comment">// return false</span></span></span><br><span class="line"><span class="javascript">            <span class="comment">// 阻止事件冒泡的方式2</span></span></span><br><span class="line"><span class="javascript">            <span class="comment">// e.stopPropagation()</span></span></span><br><span class="line"><span class="javascript">        &#125;)</span></span><br><span class="line"><span class="javascript"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></table></figure>

<h2 id="十六、事件委托"><a href="#十六、事件委托" class="headerlink" title="十六、事件委托"></a>十六、事件委托</h2><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">button</span>&gt;</span>是兄弟，就来砍我!!!<span class="tag">&lt;/<span class="name">button</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></span><br><span class="line"><span class="javascript">    <span class="comment">// 给页面上所有的button标签绑定点击事件</span></span></span><br><span class="line"><span class="javascript">    <span class="comment">// $(&#x27;button&#x27;).click(function () &#123;  // 无法影响到动态创建的标签</span></span></span><br><span class="line"><span class="javascript">    <span class="comment">//     alert(123)</span></span></span><br><span class="line"><span class="javascript">    <span class="comment">// &#125;)</span></span></span><br><span class="line"><span class="javascript"></span></span><br><span class="line"><span class="javascript">    <span class="comment">// 事件委托     </span></span></span><br><span class="line"><span class="javascript">    $(<span class="string">&#x27;body&#x27;</span>).on(<span class="string">&#x27;click&#x27;</span>,<span class="string">&#x27;button&#x27;</span>,<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span></span><br><span class="line"><span class="javascript">        alert(<span class="number">123</span>)  <span class="comment">// 在指定的范围内 将事件委托给某个标签 无论该标签是事先写好的还是后面动态创建的</span></span></span><br><span class="line"><span class="javascript">    &#125;)</span></span><br><span class="line"><span class="javascript"></span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></table></figure>

<h2 id="十七、页面加载"><a href="#十七、页面加载" class="headerlink" title="十七、页面加载"></a>十七、页面加载</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 等待页面加载完毕再执行代码</span></span><br><span class="line">window.onload = function()&#123;</span><br><span class="line">  // js代码</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="string">&quot;&quot;&quot;jQuery中等待页面加载完毕&quot;&quot;&quot;</span></span><br><span class="line"><span class="comment"># 第一种</span></span><br><span class="line">$(document).ready(function()&#123;</span><br><span class="line">  // js代码</span><br><span class="line">&#125;)</span><br><span class="line"><span class="comment"># 第二种</span></span><br><span class="line">$(function()&#123;</span><br><span class="line">  // js代码</span><br><span class="line">&#125;)</span><br><span class="line"><span class="comment"># 第三种</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;直接写在body内部最下方&quot;&quot;&quot;</span></span><br></pre></td></tr></table></figure>

<h2 id="十八、动画效果"><a href="#十八、动画效果" class="headerlink" title="十八、动画效果"></a>十八、动画效果</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).hide(<span class="number">5000</span>)</span><br><span class="line">w.fn.init [div<span class="comment">#d1]</span></span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).show(<span class="number">5000</span>)</span><br><span class="line">w.fn.init [div<span class="comment">#d1]</span></span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).slideUp(<span class="number">5000</span>)</span><br><span class="line">w.fn.init [div<span class="comment">#d1]</span></span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).slideDown(<span class="number">5000</span>)</span><br><span class="line">w.fn.init [div<span class="comment">#d1]</span></span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).fadeOut(<span class="number">5000</span>)</span><br><span class="line">w.fn.init [div<span class="comment">#d1]</span></span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).fadeIn(<span class="number">5000</span>)</span><br><span class="line">w.fn.init [div<span class="comment">#d1]</span></span><br><span class="line">$(<span class="string">&#x27;#d1&#x27;</span>).fadeTo(<span class="number">5000</span>,<span class="number">0.4</span>)</span><br><span class="line">w.fn.init [div<span class="comment">#d1]      </span></span><br></pre></td></tr></table></figure>

<h2 id="十九、补充"><a href="#十九、补充" class="headerlink" title="十九、补充"></a>十九、补充</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># each()</span></span><br><span class="line"><span class="comment"># 第一种方式</span></span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>)</span><br><span class="line">w.fn.init(<span class="number">10</span>) [div, div, div, div, div, div, div, div, div, div, prevObject: w.fn.init(<span class="number">1</span>)]</span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>).each(function(index)&#123;console.log(index)&#125;)</span><br><span class="line">VM181:<span class="number">1</span> <span class="number">0</span></span><br><span class="line">VM181:<span class="number">1</span> <span class="number">1</span></span><br><span class="line">VM181:<span class="number">1</span> <span class="number">2</span></span><br><span class="line">VM181:<span class="number">1</span> <span class="number">3</span></span><br><span class="line">VM181:<span class="number">1</span> <span class="number">4</span></span><br><span class="line">VM181:<span class="number">1</span> <span class="number">5</span></span><br><span class="line">VM181:<span class="number">1</span> <span class="number">6</span></span><br><span class="line">VM181:<span class="number">1</span> <span class="number">7</span></span><br><span class="line">VM181:<span class="number">1</span> <span class="number">8</span></span><br><span class="line">VM181:<span class="number">1</span> <span class="number">9</span></span><br><span class="line"></span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>).each(function(index,obj)&#123;console.log(index,obj)&#125;)</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">0</span> &lt;div&gt;​<span class="number">1</span>​&lt;/div&gt;​</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">1</span> &lt;div&gt;​<span class="number">2</span>​&lt;/div&gt;​</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">2</span> &lt;div&gt;​<span class="number">3</span>​&lt;/div&gt;​</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">3</span> &lt;div&gt;​<span class="number">4</span>​&lt;/div&gt;​</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">4</span> &lt;div&gt;​<span class="number">5</span>​&lt;/div&gt;​</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">5</span> &lt;div&gt;​<span class="number">6</span>​&lt;/div&gt;​</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">6</span> &lt;div&gt;​<span class="number">7</span>​&lt;/div&gt;​</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">7</span> &lt;div&gt;​<span class="number">8</span>​&lt;/div&gt;​</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">8</span> &lt;div&gt;​<span class="number">9</span>​&lt;/div&gt;​</span><br><span class="line">VM243:<span class="number">1</span> <span class="number">9</span> &lt;div&gt;​<span class="number">10</span>​&lt;/div&gt;​</span><br><span class="line"></span><br><span class="line"><span class="comment"># 第二种方式</span></span><br><span class="line">$.each([<span class="number">111</span>,<span class="number">222</span>,<span class="number">333</span>],function(index,obj)&#123;console.log(index,obj)&#125;)</span><br><span class="line">VM484:<span class="number">1</span> <span class="number">0</span> <span class="number">111</span></span><br><span class="line">VM484:<span class="number">1</span> <span class="number">1</span> <span class="number">222</span></span><br><span class="line">VM484:<span class="number">1</span> <span class="number">2</span> <span class="number">333</span></span><br><span class="line">(<span class="number">3</span>) [<span class="number">111</span>, <span class="number">222</span>, <span class="number">333</span>]</span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">有了each之后 就无需自己写for循环了 用它更加的方便</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="comment"># data()</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">能够让标签帮我们存储数据 并且用户肉眼看不见</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>).data(<span class="string">&#x27;info&#x27;</span>,<span class="string">&#x27;回来吧，我原谅你了!&#x27;</span>)</span><br><span class="line">w.fn.init(<span class="number">10</span>) [div<span class="comment">#d1, div, div, div, div, div, div, div, div, div, prevObject: w.fn.init(1)]</span></span><br><span class="line">               </span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>).first().data(<span class="string">&#x27;info&#x27;</span>)</span><br><span class="line"><span class="string">&quot;回来吧，我原谅你了!&quot;</span></span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>).last().data(<span class="string">&#x27;info&#x27;</span>)</span><br><span class="line"><span class="string">&quot;回来吧，我原谅你了!&quot;</span></span><br><span class="line">               </span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>).first().data(<span class="string">&#x27;xxx&#x27;</span>)</span><br><span class="line">undefined</span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>).first().removeData(<span class="string">&#x27;info&#x27;</span>)</span><br><span class="line">w.fn.init [div<span class="comment">#d1, prevObject: w.fn.init(10)]</span></span><br><span class="line">           </span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>).first().data(<span class="string">&#x27;info&#x27;</span>)</span><br><span class="line">undefined</span><br><span class="line">$(<span class="string">&#x27;div&#x27;</span>).last().data(<span class="string">&#x27;info&#x27;</span>)</span><br><span class="line"><span class="string">&quot;回来吧，我原谅你了!&quot;</span></span><br></pre></td></tr></table></figure>


            </div>

            <!-- Post Comments -->
            
    <!-- 使用 DISQUS_CLICK -->
<div id="disqus-comment">
    <div id="disqus_thread"></div>

<!-- add animation -->
<style>
	.disqus_click_btn {
            line-height: 30px;
            margin: 0;
            min-width: 50px;
            padding: 0 14px;
            display: inline-block;
            font-family: "Roboto", "Helvetica", "Arial", sans-serif;
            font-size: 14px;
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 0;
            overflow: hidden;
            will-change: box-shadow;
            transition: box-shadow .2s cubic-bezier(.4, 0, 1, 1), background-color .2s cubic-bezier(.4, 0, .2, 1), color .2s cubic-bezier(.4, 0, .2, 1);
            outline: 0;
            cursor: pointer;
            text-decoration: none;
            text-align: center;
            vertical-align: middle;
            border: 0;
            background: rgba(158, 158, 158, .2);
            box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
            color: #fff;
            background-color: #7EC0EE;
            text-shadow: 0
        }
</style>
	
<div class="btn_click_load" id="disqus_bt"> 
    <button class="disqus_click_btn">点击查看评论</button>
</div>

<!--
<script type="text/javascript">
$('.btn_click_load').click(function() {
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    var disqus_shortname = 'http-miccall-tech'; // required: replace example with your forum shortname

    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function() {
      var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
      dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
      (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();

    document.getElementById('disqus_bt').style.display = "none";
});
</script>
-->
<script type="text/javascript">
    var disqus_config = function () {
        this.page.url = 'https://gitee.com/AmeX/amelin-ting.git/2017/10/01/%E5%89%8D%E7%AB%AF-------jQuery/';  // Replace PAGE_URL with your page's canonical URL variable
        this.page.identifier = 'https://gitee.com/AmeX/amelin-ting.git/2017/10/01/%E5%89%8D%E7%AB%AF-------jQuery/'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
    };
</script>

<script type="text/javascript">
    $('.btn_click_load').click(function() {  //click to load comments
        (function() { // DON'T EDIT BELOW THIS LINE
            var d = document;
            var s = d.createElement('script');
            s.src = '//http-miccall-tech.disqus.com/embed.js';
            s.setAttribute('data-timestamp', + new Date());
            (d.head || d.body).appendChild(s);
        })();
        $('.btn_click_load').css('display','none');
    });
</script>
</div>
<style>
    #disqus-comment{
        background-color: #eee;
        padding: 2pc;
    }
</style>


        </div>
        <!-- Copyright 版权 start -->
                <div id="copyright">
            <ul>
                <li>&copy;Powered By <a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/" style="border-bottom: none;">hexo</a></li>
                <li>Design: <a target="_blank" rel="noopener" href="http://miccall.tech " style="border-bottom: none;">miccall</a></li>
            </ul>
            
                <span id="busuanzi_container_site_pv">本站总访问量<span id="busuanzi_value_site_pv"></span>次</span>
			
        </div>
    </div>
</body>



 	
</html>
